package main

/*
	UDP客户端
*/
import (
	msg "goProtoTest"
	"net"

	"github.com/golang/protobuf/proto"
)

func main() {
	conn, _ := net.Dial("udp", "0.0.0.0:8000")
	defer conn.Close()
	var i int32
	i = 1
	for {

		Obj := &msg.MsgReq{
			Message: "helloFromClient",
			Cnt:     i,
		}
		i++
		buffer, _ := proto.Marshal(Obj)
		conn.Write([]byte(buffer))
	}
}
